package com.xw.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author y
 * @since 2021-09-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tbl_contact")
public class Contact extends Model<Contact> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 属于哪个用户的联系人
     */
    private String openid;

    /**
     * 名字
     */
    private String name;

    /**
     * 证件类型
     */
    private String certificateType;

    /**
     * 证件号码
     */
    private String idcard;

    /**
     * 脱敏证件号码
     */
    @TableField(exist = false)
    private String desIdcard;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 逻辑删除
     */
    @JsonIgnore
    private Integer deleted;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
